home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / netinet / tcp.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-02-13  |  1.5 KB  |  64 lines

  1. #ifndef NETINET_TCP_H
  2. #define NETINET_TCP_H \
  3.        "$Id: tcp.h,v 1.1.1.1 2001/11/26 22:21:17 tboeckel Exp $"
  4. /*
  5.  *      TCP header
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. typedef    u_long    tcp_seq;
  13.  
  14. /*
  15.  * TCP header.
  16.  * Per RFC 793, September, 1981.
  17.  */
  18. struct tcphdr {
  19.     u_short    th_sport;        /* source port */
  20.     u_short    th_dport;        /* destination port */
  21.     tcp_seq    th_seq;            /* sequence number */
  22.     tcp_seq    th_ack;            /* acknowledgement number */
  23. #if BYTE_ORDER == LITTLE_ENDIAN 
  24.     u_char    th_x2:4;        /* (unused) */
  25.     u_char    th_off:4;        /* data offset */
  26. #endif
  27. #if BYTE_ORDER == BIG_ENDIAN 
  28.     u_char    th_off:4;        /* data offset */
  29.     u_char    th_x2:4;        /* (unused) */
  30. #endif
  31.     u_char    th_flags;
  32. #define    TH_FIN    0x01
  33. #define    TH_SYN    0x02
  34. #define    TH_RST    0x04
  35. #define    TH_PUSH    0x08
  36. #define    TH_ACK    0x10
  37. #define    TH_URG    0x20
  38.     u_short    th_win;            /* window */
  39.     u_short    th_sum;            /* checksum */
  40.     u_short    th_urp;            /* urgent pointer */
  41. };
  42.  
  43. #define    TCPOPT_EOL    0
  44. #define    TCPOPT_NOP    1
  45. #define    TCPOPT_MAXSEG    2
  46.  
  47. /*
  48.  * Default maximum segment size for TCP.
  49.  * With an IP MSS of 576, this is 536,
  50.  * but 512 is probably more convenient.
  51.  * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
  52.  */
  53. #define    TCP_MSS    512
  54.  
  55. #define    TCP_MAXWIN    65535        /* largest value for window */
  56.  
  57. /*
  58.  * User-settable options (used with setsockopt).
  59.  */
  60. #define    TCP_NODELAY    0x01    /* don't delay send to coalesce packets */
  61. #define    TCP_MAXSEG    0x02    /* set maximum segment size */
  62.  
  63. #endif /* !NETINET_TCP_H */
  64.